Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle #[instrument(err)] by extracting the error message #453

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

kvnvelasco
Copy link
Contributor

@kvnvelasco kvnvelasco commented Apr 1, 2022

When using #[tracing::instrument(err)] to emit error events when the wrapped function returns an error. Sentry logs show the event as an "unlabled event"

image

This PR extracts the error message as a string when the message cannot be found.

@kvnvelasco kvnvelasco changed the title Handle #[instrument(err)] correctly by extracting the error message Handle #[instrument(err)] by extracting the error message Apr 1, 2022
@kvnvelasco kvnvelasco changed the title Handle #[instrument(err)] by extracting the error message fix: Handle #[instrument(err)] by extracting the error message Apr 1, 2022
Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Would be nice to have a test for this in sentry/tests/test_tracing.rs

@kvnvelasco
Copy link
Contributor Author

kvnvelasco commented Apr 3, 2022

lgtm. Would be nice to have a test for this in sentry/tests/test_tracing.rs

Added a test case to test_tracing

@Swatinem Swatinem enabled auto-merge (squash) April 11, 2022 13:04
@Swatinem Swatinem merged commit 799f211 into getsentry:master Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants